package cn.magic.controller;

import cn.magic.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
* @Description: user 的controller
* @Author: Mr.pc
* @Version: 1.0
* @Date:  2022/7/27 19:04
*/
@RestController
public class UserController {

    @Value("${server.port}")
    private Integer ip;

    @GetMapping("/user/{id}")
    public User getByUserId(@PathVariable Long id){
        // 根据id去数据库查询
        return User.builder().id(id).name("杨幂").into("我是杨幂"+ ip).build();
    }



}
